package de.tabuma.wsdl2xform.lib;

import java.text.*;
import java.util.*;

/**
 * Class definines methods for handling datas
 * @author $Author: alefen $
 * @version $Revision: 1.2 $
 * @since $Date: 2009/07/21 20:00:57 $
 */
public class dateHandling {
    
    private static final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.UK);

    /**
     * Converts a Date into a String being a date in short format.
     * @param date The date that will be converted into a string
     * @return Returns a string
     */
    public static String fromDataToString(Date date) {
        return df.format(date);
    }
    /**
     * Converts a String being a date in short format into a date
     * @param str String to be converting into date
     * @return Returns a date
     * @throws java.text.ParseException
     */
    public static Date fromStringToData(String str) throws ParseException {
        return df.parse(str);
    }
}
